<template>
  <!-- 分页 -->
  <div style="text-align: center; margin-top: 20px">
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="params.pageNum"
      :page-size="params.PageSize"
      layout="total, prev, pager, next"
      :total="totalCount"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    params: {
      type: Object,
      default: null,
    },
    totalCount: {
      type: Number,
      default: null,
    },
  },
  data() {
    return {};
  },
  methods: {
    handleSizeChange(val) {
      this.$emit("ParamsPageSize", val);
      // console.log(`每页 ${val} 条`);
    },
    // 点击分页时触发
    handleCurrentChange(val) {
      this.$emit("ParamsPageNum", val);
      // console.log(`当前页: ${val}`);
    },
  },
};
</script>

<style>
</style>